<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta name="copyright" content="http://www.appcms.org" />
<link href="skin/base.css" rel="stylesheet" />
<link href="css/main.css" rel="stylesheet" />
<script src="js/zy_control.js"></script>
<script src="js/zy_click.js"></script>
<script src="js/config.js"></script>
<script src="js/common.js"></script>
</head>
<body ontouchstart>
<div id="main" class="box-ver box">
  <div id="header">
  	<div class="title">
  		<span class="l icon back" ontouchstart="zy_touch('act')" onclick="uexWindow.close(-1);"></span>
		<span class="txt">地图</span>
	</div>
  </div>
  
  <div id="content"></div>
</div>
</body>
<script>
zy_init();
var onTime;
var	map_x=localStorage['map_x'];
var	map_y=localStorage['map_y'];
var id=localStorage['company_id'];
var title = localStorage['share_title'];
var	imgurl='';
var	imageSize=200;	
		
function close(){
	uexBaiduMap.clean();
	uexWindow.close(-1)
}

function openmap(){	//打开地图
	var y = int($$("header").offsetHeight);
	var	s = window.getComputedStyle($$('content'),null);
	var	w = int(s.width);
	var	h = int(s.height);
	uexBaiduMap.open('6643147DF56BD40F6140AB3ABA5A3FFBE12C439F','0',y,w,h,map_x,map_y);
	if(localStorage['device']=='android'){
		uexBaiduMap.cbShowUserLocation=function(opId,dataType,data){
		}
		uexBaiduMap.showUserLocation();
	}
}
function addMark(){	//添加标注
	var W=int(document.body.clientWidth)/100;
	var W=Math.floor(W);
	var imageSize=30*W;
	var jsonstr={
		markInfo:[
			{
				id:id,
				longitude:map_x,
				latitude:map_y,
				imageUrl:'res://icon.png',
				imageWidth:imageSize,
				imageHeight:imageSize,
				message:title
			}
		]
	};
	uexBaiduMap.addMark(JSON.stringify(jsonstr));
	
}
function clearMarks(){	//删除标注
	var idarr = [0];	//要删除的标注id，以数组形式表达
	uexBaiduMap.clearMarks(idarr);	
}
function getCurrentLocation(){
	uexBaiduMap.cbGetCurrentLocation =function(i,t,data){
		addMark();
		window.clearInterval(onTime);
	};
	uexBaiduMap.getCurrentLocation();
}
window.uexOnload = function(type){
	if (!type) {
		openmap();
		onTime=window.setInterval(function(){
			getCurrentLocation();
		},1000);

		//拦截安卓返回按钮
		uexWindow.onKeyPressed = function(keycode){
    		winClose();
  		}
		uexWindow.setReportKey("0","1");
		//拦截安卓返回按钮
    }
}

</script>
</html>